package sculove.spring.zzz.comCd.model;

import org.springframework.validation.Errors;

import sculove.spring.framework.common.AbstractDto;
import sculove.spring.framework.util.SStringUtil;

public class ComCdDTO extends AbstractDto {
    private String hgrnkCdClsf;

    private String hgrnkCd;

    private String cdClsf;

    private String cd;
  
    private String cdNm;

    private String cdEngNm;

    public ComCdDTO() {
        super();
    }

    // 공통코드 생성
    public ComCdDTO(String cdClsf) {
        super();
        this.cdClsf = cdClsf;
    }

    // 상위코드 생성
    public ComCdDTO(String hgrnkCdClsf, String hgrnkCd) {
        super();
        this.hgrnkCdClsf = hgrnkCdClsf;
        this.hgrnkCd = hgrnkCd;
    }

    public String getCdClsf(){
        return cdClsf;
    }

    public void setCdClsf(String cdClsf){
        this.cdClsf = cdClsf;
    }

    public String getCd(){
        return cd;
    }

    public void setCd(String cd){
        this.cd = cd;
    }

    public String getCdNm(){
        return cdNm;
    }

    public void setCdNm(String cdNm){
        this.cdNm = cdNm;
    }

    public String getCdEngNm(){
        return cdEngNm;
    }

    public void setCdEngNm(String cdEngNm){
        this.cdEngNm = cdEngNm;
    }

    public String getHgrnkCdClsf(){
        return hgrnkCdClsf;
    }

    public void setHgrnkCdClsf(String hgrnkCdClsf){
        this.hgrnkCdClsf = hgrnkCdClsf;
    }

    public String getHgrnkCd(){
        return hgrnkCd;
    }

    public void setHgrnkCd(String hgrnkCd){
        this.hgrnkCd = hgrnkCd;
    }

	@Override
	public void validate(Object target, Errors errors) {
		ComCdDTO vo = (ComCdDTO)target;
		if(SStringUtil.hasText(vo.getCd())) {
			errors.rejectValue("cd", "required");
		}
	}
}